#include <iostream>
#include <stdio.h>
#include <unistd.h>
#include <signal.h>
using namespace std;

int count = 0;

void myHandler(int sign){
    cout << sign << " " << count << endl;
    //printf("%d\n", count);
    exit(0);
}

int main(){
    signal(SIGALRM, myHandler);
    alarm(1);
    while(true)
        ++count;
    return 0;
}